package com.bgs.engineering.api.syslog.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bgs.engineering.util.pageUtil.PageRequest;
import com.bgs.engineering.util.pageUtil.PageResult;
import com.bgs.engineering.api.syslog.entity.SysLogException;
import com.bgs.engineering.api.syslog.model.SysLogExceptionModel;
import com.bgs.engineering.common.errorCode.CommonException;
import com.bgs.engineering.common.response.CommonResult;

/**
 * 异常日志服务
 *
 * @auther zcy
 * @data 2023/3/22 13:35
 */
public interface SysLogExceptionService extends IService<SysLogException> {
  /**
   * 分页查询异常日志
   *
   * @return
   */
  PageResult selectSysLogExByPage(PageRequest pageRequest, SysLogExceptionModel sysLogExceptionModel);

  /**
   * 异常日志删除
   *
   * @param id
   * @return
   */
  CommonResult deleteSysLogEXById(Integer id) throws CommonException;

  /**
   * 日志详情
   *
   * @param id
   * @return
   */
  SysLogException selectSysLogExById(Integer id) throws CommonException;

  /**
   * 获取操作日志和异常日志比率
   *
   * @param startTime
   * @param endTime
   * @return
   */
  Integer selectSysLogByTime(String startTime, String endTime);

  /**
   * 保存异常日志
   *
   * @param sysLogExceptionModel
   * @return
   * @throws CommonException
   */
  CommonResult saveSysLogEx(SysLogExceptionModel sysLogExceptionModel) throws CommonException;
}
